package com.hainatong.shiphelper.module.cert.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.databinding.ItemCertViewBinding;
import com.hainatong.shiphelper.module.cert.entity.ShipCertBean;
import org.jetbrains.annotations.NotNull;

public class CertAdapter extends BaseQuickAdapter<ShipCertBean, BaseDataBindingHolder<ItemCertViewBinding>>
{

    public CertAdapter()
    {
        super(R.layout.item_cert_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemCertViewBinding> bindingHolder, ShipCertBean certBean)
    {
        ItemCertViewBinding binding = bindingHolder.getDataBinding();
        if( binding != null )
        {
            binding.setCert( certBean );
            binding.executePendingBindings();
        }
    }
}
